package com.david.server.rpc;

import javax.servlet.http.HttpSession;

import org.hibernate.Session;
import org.hibernate.SessionFactory;

import com.david.server.StartupListener;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;

public class RemoteService extends RemoteServiceServlet {
	protected Session getHibernateSession() {

		return ((SessionFactory) getServletContext().getAttribute(
				StartupListener.SESSION_FACTORY)).getCurrentSession();
	}
	
	protected HttpSession getHttpSession(){
		return getThreadLocalRequest().getSession();
	}
}
